/*
 * @Author: HeAo
 * @Date: 2021-10-29 16:42:02
 * @LastEditTime: 2021-10-29 17:28:27
 * @LastEditors: HeAo
 * @Description:
 * @FilePath: \web2103-2105\web2105\4-1-Nodejs\day01\sms\index.js
 * 别乱动！
 */
// 导入其他模块
let { findAllStudents, deleteStudentById } = require('./modules/student')
// 导入nodejs内置模块
let url = require('url')
let qs = require('querystring')

// const resquest = 'http://47.94.46.113:8002/student/findAll'
const resquest = 'http://47.94.46.113:8002/student/deleteById?id=5'
let urlObj = url.parse(resquest)
console.log(urlObj);

if (urlObj.pathname == '/student/findAll') {
  findAllStudents()
} else if (urlObj.pathname == '/student/deleteById') {
  const id = qs.parse(urlObj.query).id
  deleteStudentById(id)
}